package org.dormi.learn.primitive;

import org.dormi.learn.utils.Assert;

import java.util.Objects;

/**
 * 银行模型
 *
 * @author : dormi330
 * @version : 1.0
 */
public class Bank extends _Primitive_ {

    private final String code;
    private final String name;

    public Bank(String code, String name) {
        Assert.isNotNull(code, "不能为null: Bank.code");
        Assert.isNotNull(name, "不能为null: Bank.name");

        this.code = code;
        this.name = name;
    }

    /* === hash/equals === */
    /* === hash/equals === */
    /* === hash/equals === */

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Bank)) return false;
        Bank bank = (Bank) o;
        return Objects.equals(code, bank.code);
    }

    @Override
    public int hashCode() {
        return Objects.hash(code);
    }

    /* === set/get === */
    /* === set/get === */
    /* === set/get === */

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
